import React, { Component } from 'react';
import autoBind from 'react-autobind';
import { connect } from 'dva';

// widget 
import ProductionNav from '../components/Production/ProductionNav';
import ProductionBody from '../components/Production/ProductionBody'

class ProductionPage extends Component {
	constructor(props) {
        super(props)
        autoBind(this)
    }
    componentDidMount() {
    	const { dispatch, params } = this.props

    	dispatch({
    		type: 'meyley/fetchProductionDetail',
    		payload: {
    			pid: params && params.pid
    		}
    	})
    }

    render() {
    	const { meyley } = this.props

		return (
		  	<div>
		    	<ProductionNav {...this.props} />
    			<ProductionBody 
    					{...this.props} />
		    </div>
		);
	}
}

ProductionPage.propTypes = {
};

export default connect(({ meyley, address, goods }) => ({
	meyley,
	address,
	goods
}))(ProductionPage);